home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form AsciiTable
- Caption = "Ascii Table"
- ClientHeight = 5775
- ClientLeft = 165
- ClientTop = 735
- ClientWidth = 7950
- LinkTopic = "Form1"
- ScaleHeight = 5775
- ScaleWidth = 7950
- StartUpPosition = 3 'Windows Default
- Begin VB.ListBox lstAscii2
- BackColor = &H00C0C0C0&
- Columns = 1
- Height = 5100
- IntegralHeight = 0 'False
- ItemData = "Form1.frx":0000
- Left = 120
- List = "Form1.frx":0007
- TabIndex = 1
- Top = 120
- Width = 5415
- End
- Begin MSComDlg.CommonDialog comDlg
- Left = 6240
- Top = 2040
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.ListBox lstAscii1
- BackColor = &H00C0C0C0&
- Height = 5100
- IntegralHeight = 0 'False
- ItemData = "Form1.frx":0016
- Left = 120
- List = "Form1.frx":001D
- TabIndex = 0
- Top = 120
- Width = 5415
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuConvert
- Caption = "&Ascii Converter"
- End
- Begin VB.Menu mnuGame
- Caption = "Ascii &Game"
- Visible = 0 'False
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuEdit
- Caption = "&Edit"
- Begin VB.Menu mnuFont
- Caption = "&Font"
- Shortcut = ^T
- End
- Begin VB.Menu mnuDisplay
- Caption = "&Display Horizontally"
- Shortcut = ^D
- End
- Begin VB.Menu mnuFind
- Caption = "Fi&nd"
- Shortcut = ^F
- End
- Begin VB.Menu mnuFindNext
- Caption = "Find Ne&xt"
- Shortcut = {F3}
- End
- Begin VB.Menu mnuGoto
- Caption = "&Goto"
- Shortcut = ^{F3}
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuAbout
- Caption = "&About"
- Shortcut = ^A
- End
- End
- Attribute VB_Name = "AsciiTable"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim gotoLine As Integer, i As Integer, x As Integer, Char As String, findWhat
- Private Sub Form_Load()
- mnuFindNext.Enabled = False
- refreshForm
- lstAscii1.Clear
- lstAscii2.Clear
- lstAscii2.Visible = False
- For i = 0 To 255
- listAscii
- lstAscii1.AddItem (i) & Chr(9) & Char
- lstAscii2.AddItem (i) & Chr(9) & Char
- Next i
- End Sub
- Private Sub Form_Resize()
- refreshForm
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Me.WindowState = 0
- Me.Caption = "Bye Bye"
- Do While Me.Height > 405
- Me.Height = Me.Height - 100
- If Me.Width > 1680 Then
- Me.Width = Me.Width - 100
- End If
- Loop
- End Sub
- Private Sub mnuAbout_Click()
- frmAbout.Show
- End Sub
- Private Sub mnuConvert_Click()
- AsciiConvert.Show
- End Sub
- Private Sub mnuDisplay_Click()
- If mnuDisplay.Caption = "&Display Horizontally" Then
- mnuDisplay.Caption = "&Display Vertically"
- lstAscii2.ListIndex = lstAscii1.ListIndex
- lstAscii1.Visible = False
- lstAscii2.Visible = True
- Else
- mnuDisplay.Caption = "&Display Horizontally"
- lstAscii1.ListIndex = lstAscii2.ListIndex
- lstAscii1.Visible = True
- lstAscii2.Visible = False
- End If
- End Sub
- Private Sub mnuExit_Click()
- Unload Me
- End Sub
- Private Sub mnuFind_Click()
- findWhat = InputBox("Find what:")
- If findWhat = "" Then
- mnuFindNext.Enabled = False
- Else
- mnuFindNext.Enabled = True
- findNow
- End If
- End Sub
- Private Sub mnuFindNext_Click()
- findNow
- End Sub
- Private Sub mnuFont_Click()
- comDlg.Min = 6
- comDlg.Max = 14
- comDlg.Flags = cdlCFApply Or cdlCFBoth Or cdlCFLimitSize
- comDlg.ShowFont
- lstAscii1.Font = comDlg.FontName
- lstAscii1.FontSize = comDlg.FontSize
- lstAscii2.Font = comDlg.FontName
- lstAscii2.FontSize = comDlg.FontSize
- End Sub
- Private Sub mnuGame_Click()
- AsciiGame.Show
- End Sub
- Private Sub mnuGoto_Click()
- On Error GoTo ErrorHandler
- gotoLine = InputBox("Goto line:" & Chr(13) & "Enter a number")
- If gotoLine >= 0 And gotoLine <= 255 Then
- lstAscii1.ListIndex = gotoLine
- lstAscii2.ListIndex = gotoLine
- Else
- MsgBox ("You must enter a line number to go to")
- End If
- Exit Sub
- ErrorHandler:
- Select Case Err.Number
- Case 55
- Close #1
- Case Else
- End Select
- Resume
- End Sub
- Sub findNow()
- If IsNumeric(findWhat) = True Then
- If findWhat >= 10 And findWhat <= 255 Then
- MsgBox ("Use 'Goto' to find an ascii character by ascii code")
- ElseIf findWhat >= 0 And findWhat <= 9 Then
- lstAscii1.ListIndex = Asc(findWhat)
- lstAscii2.ListIndex = Asc(findWhat)
- Else
- MsgBox ("Enter a number between 0 and 9")
- End If
- ElseIf Len(findWhat) = 1 Then
- lstAscii1.ListIndex = Asc(findWhat)
- lstAscii2.ListIndex = Asc(findWhat)
- Else
- If LCase(findWhat) = "game" Or LCase(findWhat) = "play" Or LCase(findWhat) = "playgame" Or LCase(findWhat) = "play game" Then
- MsgBox ("Click on File, then Game to play the Ascii Game")
- AsciiTable.mnuGame.Visible = True
- ElseIf LCase(findWhat) = "backspace" Or LCase(findWhat) = "back space" Then
- lstAscii1.ListIndex = 8
- lstAscii2.ListIndex = 8
- ElseIf LCase(findWhat) = "tab" Then
- lstAscii1.ListIndex = 9
- lstAscii2.ListIndex = 9
- ElseIf LCase(findWhat) = "linefeed" Or LCase(findWhat) = "line feed" Then
- lstAscii1.ListIndex = 10
- lstAscii2.ListIndex = 10
- ElseIf LCase(findWhat) = "carriagereturn" Or LCase(findWhat) = "carriage return" Then
- lstAscii1.ListIndex = 13
- lstAscii2.ListIndex = 13
- ElseIf LCase(findWhat) = "undo" Then
- lstAscii1.ListIndex = 26
- lstAscii2.ListIndex = 26
- ElseIf LCase(findWhat) = "space" Then
- If lstAscii1.ListIndex = 31 Or lstAscii2.ListIndex = 32 Then
- lstAscii1.ListIndex = 160
- lstAscii2.ListIndex = 160
- Else
- lstAscii1.ListIndex = 32
- lstAscii2.ListIndex = 32
- End If
- End If
- End If
- End Sub
- Sub listAscii()
- Char = Chr(i)
- If i >= 0 And i <= 7 Or i = 11 Or i = 12 Or i >= 14 And i <= 25 Or i >= 27 And i <= 31 Or i = 127 Then
- Char = Char & Chr(9) & Chr(9) & Chr(9) & "Not supported by Microsoft Windows"
- ElseIf i = 8 Then
- Char = Char & Chr(9) & "Back space"
- ElseIf i = 9 Then
- Char = Char & "Tab"
- ElseIf i = 10 Then
- Char = Char & Chr(9) & "Line feed"
- ElseIf i = 13 Then
- Char = Char & Chr(9) & "Carriage return"
- ElseIf i = 22 Then
- Char = Char & Chr(9) & "Paste" & Chr(9) & Chr(9) & "Not supported by Microsoft Windows"
- ElseIf i = 26 Then
- Char = Char & Chr(9) & "Undo" & Chr(9) & Chr(9) & "Not supported by Microsoft Windows"
- ElseIf i = 32 Or i = 160 Then
- Char = Char & Chr(9) & "Space"
- ElseIf i >= 48 And i <= 57 Then
- Char = Char & Chr(9) & "Numbers"
- ElseIf i >= 65 And i <= 90 Then
- Char = Char & Chr(9) & "Uppercase alphabet"
- ElseIf i >= 97 And i <= 122 Then
- Char = Char & Chr(9) & "Lowercase alphabet"
- End If
- End Sub
- Sub refreshForm()
- With lstAscii1
- If Me.Height > 885 Then
- .Height = Me.Height - 885
- End If
- .Left = 120
- .Top = 120
- If Me.Width > 360 Then
- .Width = Me.Width - 360
- End If
- End With
- With lstAscii2
- If Me.Height > 885 Then
- .Height = Me.Height - 885
- End If
- .Left = 120
- .Top = 120
- If Me.Width > 360 Then
- .Width = Me.Width - 360
- End If
- End With
- End Sub
-